# $OpenBSD: Makefile,v 1.26 2017/05/31 08:08:16 espie Exp $

BROKEN-powerpc =	undefined reference to __atomic_fetch_add_8

COMMENT =		library for reading and writing images

GH_ACCOUNT = 		OpenImageIO
GH_PROJECT = 		oiio
V =			1.6.16
GH_TAGNAME =		Release-$V
DISTNAME =		openimageio-${V}

SHARED_LIBS +=		OpenImageIO		4.0 # 1.0
SHARED_LIBS +=  	OpenImageIO_Util	1.0 # 1.5

CATEGORIES =		graphics devel

HOMEPAGE =		https://sites.google.com/site/openimageio/

MAINTAINER =		Pascal Stumpf <pascal@stumpf.co>

# BSD
PERMIT_PACKAGE_CDROM =	Yes

WANTLIB += GL GLEW GLU Half Iex IlmImf IlmThread Imath OpenColorIO
WANTLIB += QtGui QtOpenGL avcodec avformat avutil boost_filesystem-mt
WANTLIB += boost_python-mt boost_regex-mt boost_system-mt boost_thread-mt
WANTLIB += boost_atomic-mt boost_chrono-mt boost_date_time-mt
WANTLIB += c freetype gif jpeg m openjpeg png pthread ${MODPY_WANTLIB}
WANTLIB += raw_r ${LIBCXX} swscale tiff webp z

MODULES =		devel/cmake \
			lang/python \
			x11/qt4 \

COMPILER =		gcc

BUILD_DEPENDS =		textproc/txt2man

LIB_DEPENDS =		devel/boost \
			graphics/openjpeg \
			graphics/tiff \
			graphics/libwebp \
			graphics/glew \
			graphics/ilmbase \
			graphics/openexr \
			graphics/giflib \
			graphics/opencolorio \
			graphics/ffmpeg \
			graphics/libraw

CONFIGURE_ARGS +=	-DPYLIB_INSTALL_DIR="lib/python${MODPY_VERSION}/site-packages" \
			-DUSE_OPENCV=OFF

CXXFLAGS +=		-pthread
.if ${MACHINE_ARCH} == "i386"
CXXFLAGS +=		-march=i686
.endif
WRKDIST =		${WRKDIR}/oiio-Release-$V

post-install:
	find ${PREFIX} -name '*.orig' -exec rm -f {} \;

.include <bsd.port.mk>
